import axios from 'axios';

const backendHost = 'http://localhost:8080'
const api = {
  // 获取用户信息
  getUser: async (id) => {
    const response = await axios.get(`${backendHost}/api/user/${id}`);
    return response.data;
  },
  
  // 获取项目列表
  getProjects: async () => {
    const response = await axios.get(`${backendHost}/api/projects`);
    // return response.data.projects;
    return response.data;
  }
};

export default api;